package com.yn.courseselectionsystem.controller;

import com.yn.courseselectionsystem.pojo.Teacher;
import com.yn.courseselectionsystem.service.impl.TeacherServiceImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @description: TODO
 * @author: Tokyo_God
 * @date: 2021/1/2 18:42
 * Role of:
 * @version: v1.0
 */
@Controller
public class TeacherController {

    @Resource
    TeacherServiceImpl teacherService;

    /**
     * 获取所以的老师以Map的格式
     * @return
     */
    @GetMapping("/teacher/selMapTeachers")
    @ResponseBody
    public Map<Integer, Teacher> selTeacherMapAll(){
        return teacherService.selTeacherMapAll();
    }

    /**
     * 获取所以的老师以List的格式
     * @return
     */
    @GetMapping("/teacher/selTeachers")
    @ResponseBody
    public List<Teacher> selTeacherAll(){
        return teacherService.selTeacherAll();
    }
}
